import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // { path: '/',component: import('../views/page/login.html')},
    { path: '/',redirect: '/manager/admin',},
   // { path: '/',redirect: '/login',},
    { path: '/manager', component: import('../views/Manager.vue'),
      children: [
        {path: 'home', component: import('@/views/Home.vue')},
        {path: 'about', component: import('@/views/AboutView.vue')},
        {path: 'admin', component: import('@/views/page/AdminInfo.vue')},
        {path: 'fileInfo', component: import('@/views/page/FileInfo.vue')},
        {path: 'userInfo', component: import('@/views/page/UserInfo.vue')},
        {path: 'typeInfo', component: import('@/views/page/TypeInfo.vue')},
        {path: 'accountAdminInfo', component: import('@/views/page/AccountAdminInfo.vue')},
        {
          path: 'diskHome',
          component: () => import('@/views/page/Home.vue'),
          props: (route) => ({ category: route.query.category, }) // 传递 props
        },
    ]
    },

    { path: '/login', component: import('../views/Login.vue'),},
    { path: '/notFound', component: import('../views/404.vue'),},
    { path: '/:pathMatch', redirect: '/notFound'},
  ],
})

export default router
